This action is used to package and generate documentation for dev container Features and Templates.
Running this action will publish dev container Features and templates in accordance with following specifications:
Dev container Feature distribution specificationDev container Template distribution specificationThis action is used in the devcontainer/features repo, in the release.yaml workflow.
UsageSee the action.yml for available options.
To best get started, create your own repo from the devcontainers/feature-starter or devcontainers/template-starter repos, customize the provided examples, and trigger the release.yaml workflow.
PermissionsWorkflow permissionsRunning this action requires the following permissions be granted:
packages: writecontents: writepull-requests: writeFor example:
jobs: deploy:if: ${{ github.ref == 'refs/heads/main' }}runs-on: ubuntu-latestpermissions: packages: write contents: write pull-requests: writesteps: - uses: actions/checkout@v3 - name: "Publish Templates"uses: devcontainers/action@v1with: publish-templates: "true" base-path-to-templates: "./src"Enable creation of pull requestsThis action will auto-generate documentation and create a pull request of those changes for your review.
Ensure Allow GitHub Actions to create and approve pull requests is enabled in your repo settings.
Optional: Setting Features/Templates as publicFeatures or Templates published to a registry are private by default. Access controls are managed by the registry. To share your Feature or Template with others outside your organization, you may update the visibility to public.
To do so, publish your Feature or Template and navigate to its setting page. To see packages you have published to the GitHub Container Registry, navigate to the following URL:
https://github.com/?tab=packages
Pinning devcontainer CLI versionThis action heavily relies on the devcontainers/cli for various operations. By default, this action will fetch the latest version published to npm. The devcontainer-cli-version property can be used to pin to a specific CLI release. Eg:
- name: "Publish Features" uses: devcontainers/action@v1 with:publish-features: "true"base-path-to-features: "./src"devcontainer-cli-version: "0.53.0"The changelog for the CLI can always be found here: https://github.com/devcontainers/cli/blob/main/CHANGELOG.md
DesignInternally, this GitHub Action will fetch the latest published version of the Dev Container CLI and execute the appropriate CLI commands - namely devcontainer features publish and devcontainer templates publish.